package com.wen.design.service.impl;

import com.wen.design.service.PayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

@Slf4j
@Service
public class AliPayServiceImpl implements PayService {
    @Override
    public Map<String, Object> procedurePay(Long productId) {
        log.info("【支付宝方法】下单产品，id:{}",productId);

        log.info("保存订单到数据库，订单id:{}", UUID.randomUUID());

        log.info("调用-微信下单接口");

        log.info("获得响应结果，返回支付二维码");
        HashMap<String, Object> map = new HashMap<>();
        map.put("code_url","https://www.baidu.com");
        map.put("payType","支付宝支付");
        return map;
    }

    @Override
    public Map<String, Object> procedurePayNotify(HttpServletRequest request, HttpServletResponse response) {

        return null;
    }
}
